package com.kujie.access.utils;

import java.text.DecimalFormat;

/**
 * 计算工具类
 *
 * @author check
 * @date 2025-05-27
 */
public class CalculationUtil {

    public static double getPercentage(double numerator, double denominator) {
        if (denominator == 0) {
            return 0.00;
        }
        double result = numerator / denominator * 100;
        DecimalFormat df = new DecimalFormat("0.00");
        return Double.parseDouble(df.format(result));
    }
}
